<template>
	<view class="notice-wrap">
		<view class="topVue">
			<view class="status"></view>
			<view class="navVue">
				<image src="../../static/imgs/back.png" style="width: 36rpx; height: 36rpx;" @click="backFun"></image>
				<view class="nav-title">{{$t("站内公告")}}</view>
				<view style="width: 36rpx; height: 36rpx;"></view>	
			</view>
		</view>
		
		<view class="place"></view>
		
		<view class="content-wrap" v-for="item in noticeList" :key="item.id">
			<view class="top-box">
				<view class="title">{{ item.title }}</view>
				<view class="time">{{ item.updateTime }}</view>
			</view>
			<view class="notive" v-html="item.content"></view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				noticeList: [],
			};
		},
		onLoad() {
			this.getNoticeList()
		},
		methods: {
			// 获取公告
			getNoticeList() {
				this.$http.post('/search/indexContent', {}).then(res => {
					this.noticeList = res.obj.contentList
				})
			},
			backFun(){
				uni.navigateBack({
					delta:1
				})
			}
		},
	};
</script>

<style lang="scss" scoped>
	.notice-wrap {
		width: 100%;
		height: 100%;
		background: url("../../static/imgs/bg.png") no-repeat;
		background-size: 100% 100%;
		box-sizing: border-box;
		position: fixed;
		
		.place {
			height: calc(var(--status-bar-height) + 92rpx);
		}
		
		.topVue {
			width: 100%;
			position: absolute;
			left: 0;
			top: 0;
			z-index: 99;
		
			.status {
				width: 100%;
				height: var(--status-bar-height);
			}
		
			.navVue {
				width: 100%;
				height: 92rpx;
				background: linear-gradient(to right, #FFFBFF, #FFE7F4);
				display: flex;
				justify-content: space-between;
				align-items: center;
				box-sizing: border-box;
				padding: 0 30rpx;
		
				.nav-title {
					width: 420rpx;
					height: 92rpx;
					font-size: 36rpx;
					color: #04094C;
					text-align: center;
					line-height: 92rpx;
				}
			}
		}

		.content-wrap {
			width: 690rpx;
			height: auto;
			background-color: #fff;
			border-radius: 20rpx;
			box-sizing: border-box;
			padding: 37rpx 32rpx 49rpx;
			margin: 30rpx auto 0;

			.top-box {
				width: 100%;
				display: flex;
				justify-content: space-between;
				align-items: center;
				height: 34rpx;
				font-family: PingFang SC;
				margin-bottom: 52rpx;

				.title {
					font-weight: 400;
					font-size: $uni-font-size-34;
					color: #333;
				}

				.time {
					font-size: $uni-font-size-24;
					font-weight: 300;
					color: #666;
				}
			}

			.notive {
				width: 100%;
				font-size: $uni-font-size-30;
				font-family: PingFang SC;
				font-weight: 300;
				color: $uni-text-color-666;
				line-height: 42rpx;
			}
		}
	}
</style>